<!--
 * @Description: In User Settings Edit
 * @Author: your name
 * @Date: 2019-09-04 12:05:09
 * @LastEditTime: 2019-09-16 11:02:16
 * @LastEditors: Please set LastEditors
 -->
<template>
    <div class="bank">
        <ul @click="chooseIndex">
            <li v-for="(item,index) in question_bank" :data-index="index+1" :key="index" :style="['background:']+(item.isRight != null ?(item.isRight?'#00ad39':'#f1000b'):'')">{{index+1}}</li>
        </ul>
    </div>
</template>

 
<script>
export default {
    data(){
        return {
            question_bank:{},
        }
    },
    onLoad(options){
        const conclusion = wx.getStorageSync('conclusion')
        const num = options.length
        const question_bank = []
        for(let i=0;i<num;i++){
            question_bank.push(conclusion[i])
        }
        // console.log(question_bank)
        this.$set(this,'question_bank',question_bank)
    },
    methods:{
        chooseIndex(e){
            const index = e.target.dataset.index
            if(index){
                wx.redirectTo({
                    url:"/pages/question/main?index="+index
                })
            }
        }
    }
}
</script>


<style lang="less" scoped>
    .bank{
        min-height: 100vh;
        background: #000b41;
        overflow: hidden;
        ul{
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            margin-top: 25rpx;
            margin-bottom: 25rpx;
            li{
                width: 76rpx;
                height: 76rpx;
                font-size: 36rpx;
                display: inline-block;
                border-radius: 100%;
                text-align: center;
                line-height: 76rpx;
                margin: 17rpx;
                color:white;
                background: #1c2760;
            }
        }
    }
</style>
